So the basis of my game is a simple click, you get a prompt, and an item. In the studio version, it works perfectly fine, but in the published game, you only get the prompt (from another script). I don't know how to fix this. I've tried replacing it with other versions, but NOTHING will work. Any ideas?
function onClicked(part) local player = game.Players.LocalPlayer local giver = game.Players:FindFirstChild(""..player.Name.."") print("Clicked") if player ~= nil then local wep = game.Lighting.Key:clone() wep.Parent = giver.Backpack end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Try this
function onClicked(player) print("Clicked") if player then local wep = game:GetService("Lighting"):WaitForChild("Key"):Clone() wep.Parent = player.Backpack end end script.Parent.ClickDetector.MouseClick:connect(onClicked)