【发布时间】:2020-09-11 16:01:21
【问题描述】:
我正在努力使其成为玩家可以进行自定义的地方,但是当它设置 Color3 值时,它会更改为比正常参数大得多的数字。例如,当脚本尝试将值设置为 (255,0,0) 时,它会转到 (65025, 0, 0)。这是代码,我做错了什么?
script.Parent.MouseButton1Click:Connect(function()
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent
print("CustomChanged")
if script.Parent.Value.Value == Color3.new(0,0,0) then
script.Parent.Value.Value = Color3.new(255,255,255)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255,255,255) then
script.Parent.Value.Value = Color3.new(255,0,0)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255,0,0) then
script.Parent.Value.Value = Color3.new(255, 136, 0)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255, 136, 0) then
script.Parent.Value.Value = Color3.new(255,255,0)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255,255,0) then
script.Parent.Value.Value = Color3.new(0,255,0)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(0,255,0) then
script.Parent.Value.Value = Color3.new(0,255,255)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(0,255,255) then
script.Parent.Value.Value = Color3.new(0,0,255)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(0,0,255) then
script.Parent.Value.Value = Color3.new(255,0,255)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255,0,255) then
script.Parent.Value.Value = Color3.new(255,0,205)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
elseif script.Parent.Value.Value == Color3.new(255,0,205) then
script.Parent.Value.Value = Color3.new(0,0,0)
Player.Skins.Custom.Head.Color.Value = script.Parent.Value.Value
script.Parent.Parent.Parent.Character.Custom.Head.Color = script.Parent.Value.Value
script.Parent.Frame.BackgroundColor3 = script.Parent.Value.Value
end
end)
【问题讨论】: