local decalId = script.Parent.DecalBox.Text
local submitButton = script.Parent.SubmitButton
local decalIdSubmitEvent = game:GetService("ReplicatedStorage"):WaitForChild("DecalIdSubmitEvent")
submitButton.MouseButton1Click:Connect(function()
decalIdSubmitEvent:FireServer(decalId)
print(decalId)
print("Decal Id successfully sent")
end)
local script
handler for texture
local decalIdSubmitEvent = game:GetService("ReplicatedStorage"):WaitForChild("DecalIdSubmitEvent")
decalIdSubmitEvent.OnServerEvent:Connect(function(player, decalId)
print(decalId)
print("Successfully recieved")
local texture = "http://www.roblox.com/asset/?id="..decalId
local decal = Instance.new("Decal")
decal.Texture = texture
decal.Parent = script.Parent.WhiteBoard
decal.Face = "Back"
print("Changed")
end)
No errors, but it does even print anything for line 4 of local script. Any ideas? Text is 100% all good and stuff…
change line 4 to
local decalId = tonumber(script.Parent.DecalBox.Text)
because it will stay as a string if you dont, so if you pass the decalId to the another script it may error thus;
local decalId = tonumber(script.Parent.DecalBox.Text)
local submitButton = script.Parent.SubmitButton
local decalIdSubmitEvent = game:GetService("ReplicatedStorage"):WaitForChild("DecalIdSubmitEvent")
submitButton.MouseButton1Click:Connect(function()
decalIdSubmitEvent:FireServer(decalId)
print(decalId)
print("Decal Id successfully sent")
end)
local decalIdSubmitEvent = game:GetService("ReplicatedStorage"):WaitForChild("DecalIdSubmitEvent")
script.Parent.Changed:Connect(function()
if script.Parent.Text ~= nil and script.Parent.Text ~= "" then
decalIdSubmitEvent:FireServer(script.Parent.Text)
end
end)
script:
local decalIdSubmitEvent = game:GetService("ReplicatedStorage"):WaitForChild("DecalIdSubmitEvent")
decalIdSubmitEvent.OnServerEvent:Connect(function(player, decalId)
local decal = Instance.new("Decal")
decal.Texture = "http://www.roblox.com/asset/?id="..decalId
decal.Parent = script.Parent.WhiteBoard
decal.Face = "Back"
end)